#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

#include "glwidget.h"

#include "csgnode.h"

#include "geometrictransformationsdialog.h"

#include <QList>

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void connect_slots();
    void setup_canvas();
public slots:
    void update_canvas();
    void update_colors();
    void add_primitive();
    void add_operation();
    void add_transformation();
    void update_selection();
    void remove_node();
    void context_menu(const QPoint & pos);
    void hide_object();
    void show_object();
protected:
    void keyPressEvent(QKeyEvent *);
private:
    Ui::MainWindow *ui;
    GLWidget *m_gl_widget;
    Canvas *m_canvas;
    QList<QSharedPointer<CSGNode> > m_nodes_list;
    QList<QSharedPointer<CSGPrimitive> > m_primitives_list;
    QSharedPointer<CSGNode> m_current_node;
    QSharedPointer<CSGPrimitive> m_current_primitive;
    QHash<QTreeWidgetItem* ,QSharedPointer<CSGNode> > m_tree_nodes_map;
    unsigned int m_cylinder_count;
    unsigned int m_sphere_count;
    unsigned int m_cube_count;
    unsigned int m_cone_count;
};

#endif // MAINWINDOW_H
